package socket;

import java.util.zip.CRC32;


public class CRC {
	  public static void main(String[] args){
		  String str="9220140528162927021309000000  900000000000370110012200000000011000001000000000000000000060000      0006       0022014052816292710B909C9";
		  System.out.println(getCRC32(str));
		  if (getCRC32(str).length()==7) {
			  System.out.println("0"+getCRC32(str));
		  }
		 
	  }
	  //获取CRC32校验码
	  public static String getCRC32(String str){
		  CRC32 crc32 = new CRC32();
		  crc32.update(str.getBytes());
		  String crc= Long.toHexString(crc32.getValue());
		  crc=CompletionStr.compStr0(crc, 8);
		  return  crc.toUpperCase();
	  }
}
